<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        ul {
            width: 100px;
            list-style-type: none;
            display: none;
            position: absolute;
        }
        li {
            border: 1px solid red;
            height: 24px;
            line-height: 24px;
            text-align: center;
            margin: 1px;
        }
    </style>
</head>
<body>
    <ul>
        <li>A</li>
        <li>B</li>
        <li>C</li>
    </ul>
    <script>
        const ul = document.querySelector("ul")
        window.addEventListener("contextmenu", function(e){
            e.preventDefault()
            let X = e.clientX
            let Y = e.clientY
            ul.style.display = "block"
            ul.style.left = X + "px"
            ul.style.top = Y + "px"
            console.log(X, Y)
        })
    </script>
</body>
</html>